
<script type="text/javascript">

$(document).ready(function(){

    $('#alipay').click(function(){
        $('#selectbank').attr('style','display:none');
        $('#isbank').attr('style','display:none');
        $('#showpaytype').html('<img class="vam" src="../Public/images/alipay.jpg" />');
        $('#showpaytip').html('<p>采用支付宝方式充值</p>');
    });

    $('#yeepay').click(function(){
        //$('#selectbank').attr('style','display:inline');//先屏蔽易宝的银行选择功能
        //$('#isbank').attr('style','display:inline');//先屏蔽易宝的银行选择功能
        $('#showpaytype').html('<img class="vam" src="../Public/images/yeepay.gif" />');
        $('#showpaytip').html('<p>采用易宝支付方式充值</p>');
    });

    $('#chinabank').click(function(){
        //$('#selectbank').attr('style','display:inline');//先屏蔽易宝的银行选择功能
        //$('#isbank').attr('style','display:inline');//先屏蔽易宝的银行选择功能
        $('#showpaytype').html('<img class="vam" src="../Public/images/chinabank.jpg" />');
        $('#showpaytip').html('<p>采用网银在线方式充值</p>');
    });

    $('#tenpay').click(function(){
        //$('#selectbank').attr('style','display:inline');//先屏蔽易宝的银行选择功能
        //$('#isbank').attr('style','display:inline');//先屏蔽易宝的银行选择功能
        $('#showpaytype').html('<img class="vam" src="../Public/images/tenpay.gif" />');
        $('#showpaytip').html('<p>采用财付通方式充值</p>');
    });


    <eq name="tenpay.state" value="1">
		$('#showpaytype').html('<img class="vam" src="../Public/images/tenpay.gif" />');
		$('#showpaytip').html('<p>采用财付通方式充值</p>');
		selectPaytype(4);
	</eq>
    <eq name="chinabank.state" value="1">
		$('#showpaytype').html('<img class="vam" src="../Public/images/chinabank.jpg" />');
		$('#showpaytip').html('<p>采用网银在线方式充值</p>');
		selectPaytype(3);
    </eq>
	<eq name="yeepay.state" value="1">
		$('#showpaytype').html('<img class="vam" src="../Public/images/yeepay.gif" />');
        $('#showpaytip').html('<p>采用易宝支付方式充值</p>');
		selectPaytype(2);
	</eq>
	<eq name="alipay.state" value="1">
		$('#showpaytype').html('<img class="vam" src="../Public/images/alipay.jpg" />');
		$('#showpaytip').html('<p>采用支付宝方式充值</p>');
		selectPaytype(1);
	</eq>
});



//发送用户充值点卡的操作
function checkpoint(beat,type,price,pointb,pointc){
    $('#showprice').html('&yen;'+price);
	var text=beat+BEATNAME;
	
    if(pointb != 0 && pointb != '' && pointb != null && typeof(pointb) != 'undefined')
    {
        text += ' + '+pointb+POINTBNAME;
    }

	if(pointc != 0 && pointc != '' && pointc != null && typeof(pointc) != 'undefined')
    {
        text += ' + '+pointc+POINTCNAME;
    }
    

	$('#showpoint').text(text);
    $('#pointtype').val(type);
    $('#point_'+type).attr('checked','true');
    
    ///重新赋值
    $('#paypoint_price').val(price);
    $('#paypoint_point').val(beat);
    $('#paypoint_id').val(type);
    
}

//发送用户充值点卡的操作
function send_cardform(){
    productname = "{$Think.config.sysconfig.beat_name}充值";
    paytype = $('#paytype').attr('value');
    orderprice = $('#paypoint_price').attr('value');
    orderpoint = $('#paypoint_point').attr('value');
    pointtype = $('#pointtype').val();
    ordersn = "";
    oid = "";
    ptype = $('#type').attr('value');
    tid = "";
    $.post(APP+"/Member/ajax_prepay",
    {
    'id':tid,
    'productname':productname,
    'paytype':paytype,
    'paypoint_price':orderprice,
    'paypoint_point':orderpoint,
    'ordersn':ordersn,
    'oid':oid,
    'type':ptype,
    'pointtype':pointtype
    },
    function(data,success){
        if(data!='0'){
            paylink = data;
            addDialogbox("#mb_pay","您确认支付本信息吗?",10003,550);
            var content=$('#payinfotext').html();
            var msg='<p>系统将会在新打开的窗口上支付操作！</p><p>支付操作完成前请不要关闭此窗口。</p>'+
                    '<div class="paragraph" id="paybtn" style="display:block">'+
                        '<span class="button">'+
                            '<span class="first-child">'+
                               '<a style="padding-top:0px;line-height:32px;" href="'+paylink+'" target="_blank">确认支付</a>'+
                            '</span>'+
                        '</span>'+
                        '<span class="button">'+
                            '<span class="first-child">'+
                                '<button type="button" class="f12" onclick="mb_pay_no()">返回编辑</button>'+
                            '</span>'+
                        '</span>'+
                    '</div>'+
                    '<div class="paragraph" id="waitbtn" style="display:none">'+
                        '<span class="button">'+
                            '<span class="first-child">'+
                                '<button type="button" class="f12" onclick="mb_pay_ok()">我已支付完成了,返回用户首页</button>'+
                            '</span>'+
                        '</span>'+
                    '</div>';
            $("#mb_pay .dialogboxContent").html("<p>"+content+"</p>"+msg);
        }
    });
}

function mb_pay_ok(){
    parent.gotourl(APP+"/Member/index");
}
function mb_pay_no(){
    removeDialogbox("#mb_pay");
}

function mb_pay_yes(goUrl){
    window.open(goUrl,'_blank');
    $('#waitbtn').attr('style','display:inline');
    $('#paybtn').attr('style','display:none');
    //$('#waitbtn').submit();
}

function selectPaytype(n){
    $('#paytype').attr('value',n);
}

//银行的类型
function selsectbank(b){
    $('#showbanktype').html('<img class="vam" src="../Public/images/'+b+'.jpg" />');
}

//设定默认的点卡
checkpoint({$packagedata.0.beat},{$packagedata.0.id},{$packagedata.0.amount},{$packagedata.0.pointb},{$packagedata.0.pointc});

</script>




<form action="__APP__/Member/checkout/" method="post" id='checkout' >

    <input type="hidden" value="" name="paypoint_price" id="paypoint_price" />
    <input type="hidden" value="" name="paypoint_point" id="paypoint_point" />
    <input type="hidden" value="" name="paypoint_id" id="paypoint_id" />
    <input type="hidden" value="0" name="type" id="type" />
    <input type="hidden" name="paytype" id="paytype" value="1" />

    <fieldset id="pointType">
        <legend>选择点卡</legend>
        <ul class="clearfix" style="width: 720px; display: inline-table;">
        <volist name="packagedata" id="vo">
        	<li>
                <label for="point_{$vo.id}" onclick="javascript:checkpoint({$vo.beat},{$vo.id},{$vo.amount},{$vo.pointb},{$vo.pointc});">
                    <img class="paibanPointCard pointCard" src="__PUBLIC__/accessory/upload/Package/{$vo.path}" />
                    <p>
                    	<input id="point_{$vo.id}" class="radio" name="pointradio" type="radio" onclick="checkpoint({$vo.beat},{$vo.id},{$vo.amount},{$vo.pointb},{$vo.pointc});" />
                   		<span class="price" onclick="javascript:checkpoint({$vo.beat},{$vo.id},{$vo.amount},{$vo.pointb},{$vo.pointc});" >&yen;{$vo.amount}</span>
                    </p>
                </label>
            </li>
        </volist>
			<div style="clear:both;"></div>
        </ul>
    </fieldset>
    


    <fieldset class="paymentType">
        <legend>支付方式</legend>
        <ul>
            <li <eq name="alipay.state" value="0">style="display:none"</eq>>
                <input id="alipay" name="paytype" class="radio" value="1" type="radio" checked onClick="javascript:selectPaytype(1);" />
                <label for="alipay" ><img class="vam" src="../Public/images/alipay.jpg" /></label>
            </li>
            
            <!-- 
            <li <eq name="yeepay.state" value="0">style="display:none"</eq>>
                <input id="yeepay" name="paytype"  value="2" class="radio"  type="radio"  onClick="javascript:selectPaytype(2);" />
                <label for="yeepay"><img class="vam" src="../Public/images/yeepay.gif" /></label>
            </li>
            <li <eq name="chinabank.state" value="0">style="display:none"</eq>>
                <input id="chinabank" name="paytype"  value="3" class="radio"  type="radio"  onClick="javascript:selectPaytype(3);" />
                <label for="chinabank"><img class="vam" src="../Public/images/chinabank.jpg" /></label>
            </li>
            <li <eq name="tenpay.state" value="0">style="display:none"</eq>>
                <input id="tenpay" name="paytype"  value="4" class="radio"  type="radio"  onClick="javascript:selectPaytype(4);" />
                <label for="tenpay"><img class="vam" src="../Public/images/tenpay.gif" /></label>
            </li>
             -->
             
        </ul>
    </fieldset>
    
    
    
	<!-- 
    <fieldset class="paymentType" id="selectbank" style="display:none">
        <legend>选择银行 <span class="keyword">（将会新窗口打开网上银行页面）</span></legend>
        <ul>
            <li>
                <input id="cmb" name="banktype" class="radio" value="cmb" type="radio" checked />
                <label for="cmb" onclick="selsectbank('cmb');"><img class="vam" src="../Public/images/cmb.jpg" /></label>
            </li>
            <li>
                <input id="bc" name="banktype" class="radio" value="bc" type="radio" />
                <label for="bc" onclick="selsectbank('bc');"><img class="vam" src="../Public/images/bc.jpg" /></label>
            </li>
            <li>
                <input id="abc" name="banktype" class="radio" value="abc" type="radio" />
                <label for="abc" onclick="selsectbank('abc');"><img class="vam" src="../Public/images/abc.jpg" /></label>
            </li>
            <li>
                <input id="icbc" name="banktype" class="radio" value="icbc"  type="radio" />
                <label for="icbc" onclick="selsectbank('icbc');"><img class="vam" src="../Public/images/icbc.jpg" /></label>
            </li>
            <li>
                <input id="ccb" name="banktype" class="radio" value="ccb"  type="radio" />
                <label for="ccb" onclick="selsectbank('ccb');"><img class="vam" src="../Public/images/ccb.jpg" /></label>
            </li>
        </ul>
    </fieldset>
 	-->
 	
 	
 	   <fieldset class="paymentType">
        <legend>汇款方式</legend>
        <p class="tc f14">
        	工商银行账号：622200107246825
        </p>
    </fieldset>
    

    <fieldset class="paymentType">
        <legend>提示信息</legend>
        <p id="showpaytip"></p>
        <p class="tc f14">
        为确保充值及时到账：支付成功后，<strong class="keyword">请等待跳转到{$Think.config.sysconfig.webname}支付成功页面，</strong>再关闭窗口。
        <br />
        </p>
    </fieldset>
    
    
    
    <div id="gotoBuy" class="tc">
        <p id="payinfotext" class="f14">
            <span>您选择了<strong class="keyword" id="showprice"></strong>的点卡</span>
            <span class="space">（<strong class="keyword"><span id="showpoint"></span></strong>）</span>
            <span class="space">支付方式：<strong id="showpaytype"><img class="vam" src="../Public/images/alipay.jpg" /></strong></span>
            <span id="isbank" style="display:none">网上银行：<strong id="showbanktype"><img class="vam" src="../Public/images/cmb.jpg" /></strong></span>
        </p>
        <input type="hidden" id="pointtype" name="pointtype" value="" />
        <span class="button">
            <span class="first-child">
                <button type="button" class="strong" onclick="send_cardform();">确定充值</button>
            </span>
        </span>
    </div>
    
    

</form>